import 'package:flutter/material.dart';
import 'package:shudu/utils/global.dart';
import 'package:get/get.dart';
import 'package:shudu/utils/image_utils.dart';

class AppbarWidget extends StatelessWidget {
  final String title;

  AppbarWidget(this.title);

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: const BoxDecoration(
          color: mainColor,
          borderRadius: BorderRadius.only(
              bottomLeft: Radius.circular(18),
              bottomRight: Radius.circular(18))),
      padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
      child: Container(
        height: 50,
        width: Get.width,
        padding: const EdgeInsets.symmetric(horizontal: 16),
        child: Stack(
          alignment: Alignment.center,
          children: [
            Positioned(
                left: 0,
                child: GestureDetector(
                  onTap: () {
                    Get.back();
                  },
                  child: loadAssetImage("icon_back", width: 24),
                )),
            Text(
              title,
              style: const TextStyle(
                  color: Colors.white, fontSize: 16),
            )
          ],
        ),
      ),
    );
  }
}
